# from db.common import cli
# import datetime
#
#
# def get_department_impl(login_name):
#     login__name_dim = '%'+login_name+'%'
#     sql_department = "select project_id,project_name from tb_project where owner like '%s'"%login__name_dim
#     print(sql_department)
#     return cli.fetchall(sql_department)
#
# def add_task_impl(title,author,content,project,remark,status):
#     # 1.得到当前时间戳
#     time = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
#     #2.得到部门人员
#     sql_users = "select owner from tb_project where  project_name = '%s' "%project
#     users = cli.fetchall(sql_users)[0]
#     print(users)
#     sql_add = "insert into tb_items (publish_time,author,receiver,title,content,project,update_time,status,remark) " \
#               "values('%s','%s','%s','%s','%s','%s','%s','%s','%s')"\
#               %tuple([time,author,users['owner'],title,content,project,time,status,remark])
#     print(sql_add)
#     cli.execute(sql_add)
#
#
# def read_task_impl(login_name):
#     login_name_dim = '%'+login_name+'%'
#     sql = "select * from tb_items where receiver like '%s'"%login_name_dim
#     return cli.fetchall(sql)
#
#
# def modify_task_impl(item_id,title, author, content, project, remark, status):
#     # 1.得到当前时间戳
#     time = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
#     # 2.得到部门人员
#     sql_users = "select owner from tb_project where  project_name = '%s' " % project
#     users = cli.fetchall(sql_users)[0]
#     sql_update = "update tb_items set receiver='%s',title='%s',content='%s',project='%s',update_time='%s',status='%s',remark='%s' " \
#                  "where item_id='%s' and author='%s'"%tuple([users['owner'],title,content,project,time,status,remark,item_id,author])
#     print(sql_update)
#     cli.execute(sql_update)
#
#
